package com.java.controller;
import com.java.pojo.User;
import com.java.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * description:描述
 * author:作者
 * time:2020/11/2 15:36
 */
@Controller
public class HomeController {

    @Autowired
    private UserService userService;

    @RequestMapping("/textController.do")
    public @ResponseBody List<String> textController(){
        return Arrays.asList("长春","杭州","温州");
    }

    /**
     * 获取所有用户
     * @return
     */
    @RequestMapping("/findUser.do")
    public @ResponseBody List<User> findUser(){
        return userService.getAllUser();
    }


}
